<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>商品订单列表</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0" />
    <#include "/view/admin/head.html"/>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
    <script type="text/javascript" src="${base}/jstool/bootstrap-select/js/bootstrap-select.min.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-select/lang/defaults-zh_CN.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-select/css/bootstrap-select.min.css" />

    <style type="text/css">
        .table-class{
            width:90%;
            text-align: center;
            border:1px solid #afd9ee;
            margin:0 auto;
            margin-top: 50px;
        }
        .list-path{
            height: 50px;
            line-height: 50px;
            background-color: #9acfea;

        }
        table th{
            text-align: center;
            WORD-WRAP: break-word;
            width: 100px;
        }
        table thead tr {
            background-color: #9acfea;
        }
        .table-query{
            /*height: 40px;*/
            /*width:80px;*/
            /*text-align: center;*/
            white-space:nowrap;
            /*position: relative;*/
            float: left;
            display:inherit;
            /*display: inline;*/


        }
        .label-head{
            height: 60px;
            width: 100%;
        }
        .bs-example .input-group{
            width:300px;
            float: left;
            margin-top:20px;

        }
        .bank-label{
            width:25px;
            float: left;
        }
        .label-hidden{
            display: none;
        }
        .panel-body{
            padding-top: 0px;
        }
        .input-group input[type='text']{
            z-index: inherit;
        }
       /* .input-group{
            margin-top:20px;
        }*/
    </style>
    <script type="text/javascript">
        function query(dm){
            var href = "${base}/czjorder/list.do?";

            href+='orderCode='+$('#orderCode').val();
            href+='&'
            href+='businessId='+$('#businessId').val();
            href+='&'
            href+='status='+$('#status').val();
            href+='&'
            href+='createTimeStart='+$('#createTimeStart').val()+"&";
            href+='createTimeEnd='+$('#createTimeEnd').val();
            href+='&'
            href+='remark='+$('#remark').val()+"&";
            href+='phone='+$('#phone').val();
                    

            location.href=href;
        }
        $(function() {
            //初始化
                $('#createTimeStart').datetimepicker({language: 'zh-CN', todayBtn : true });
                $('#createTimeEnd').datetimepicker({language: 'zh-CN', todayBtn : true });
        });
    </script>
</head>
<body>

<#include "/view/admin/listnav.html"/>
<div class="table-class">
    <div class="panel panel-default" style="margin: 10px 50px 10px;">
     <div class="panel-body">
        <form class="bs-example bs-example-form" role="form">

            <div class="input-group">
                <span class="input-group-addon">订单编号</span>
                <input type="text" id="orderCode" class="form-control" value="${entity.orderCode!}" placeholder="请输入订单编号">
            </div>
                <span class="bank-label">&nbsp;</span>
            <div class="input-group">
                <span class="input-group-addon">手机号</span>
                <input type="text" id="phone" class="form-control" value="${entity.phone!}" placeholder="请输入手机号">
            </div>
            <span class="bank-label">&nbsp;</span>

           <#-- <div class="input-group">
                <span class="input-group-addon">用户</span>
                <select id="userinfoId" name="userinfoId"
                        class="form-control selectpicker"   data-live-search="true"
                >
                    <option value="">请选择用户</option>
                            <#list listUserinfoId as lv>
                                <option value="${lv.value!}"
                                <#if entity.userinfoId??&&entity.userinfoId == lv.value >
                                    selected="selected"
                                </#if>
                                >${lv.name!}</option>
                            </#list>

                </select>

            </div>
                <span class="bank-label">&nbsp;</span>-->


            <div class="input-group">
                <span class="input-group-addon">商家</span>
                <select id="businessId" name="businessId"
                        class="form-control selectpicker"   data-live-search="true"
                >
                    <option value="">请选择商家</option>
                            <#list listBusinessId as lv>
                                <option value="${lv.value!}"
                                <#if entity.businessId??&&entity.businessId == lv.value >
                                    selected="selected"
                                </#if>
                                >${lv.name!}</option>
                            </#list>

                </select>

            </div>
                <span class="bank-label">&nbsp;</span>
<div class="input-group">
                <span class="input-group-addon">订单状态</span>
                <select id="status" name="status"
                        class="form-control"
                >
                    <option value="">请选择订单状态</option>
                    <option value="0" <#if entity.status??&&0 == entity.status>selected="selected"</#if>>待支付</option>
                    <option value="7" <#if entity.status??&&7 == entity.status>selected="selected"</#if>>待收货</option>
                    <option value="8" <#if entity.status??&&8 == entity.status>selected="selected"</#if>>已完成</option>
                    <option value="10" <#if entity.status??&&10 == entity.status>selected="selected"</#if>>等待退款</option>
                    <option value="13" <#if entity.status??&&13 == entity.status>selected="selected"</#if>>待发货</option>
                    <option value="16" <#if entity.status??&&16 == entity.status>selected="selected"</#if>>等待退款</option>
                    <option value="17" <#if entity.status??&&17 == entity.status>selected="selected"</#if>>订单已取消</option>
                    <option value="18" <#if entity.status??&&18 == entity.status>selected="selected"</#if>>退货退款成功</option>

                </select>

            </div>
                <span class="bank-label">&nbsp;</span>


                <div class="input-group">
                    <span class="input-group-addon">开始下单时间</span>
                    <input type="text" id="createTimeStart" class="form-control" value="<#if (entity.createTimeStart)?? >${entity.createTimeStart?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="createTimeStart" name="createTimeStart" data-date-format="yyyy-mm-dd hh:ii:ss">
                </div>
                <span class="bank-label">&nbsp;</span>
                <div class="input-group">
                    <span class="input-group-addon">结束下单时间</span>
                    <input type="text" id="createTimeEnd" class="form-control" value="<#if (entity.createTimeEnd)?? >${entity.createTimeEnd?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="createTimeEnd" name="createTimeEnd" data-date-format="yyyy-mm-dd hh:ii:ss">
                </div>
                <span class="bank-label">&nbsp;</span>

            <div class="input-group">
                <span class="input-group-addon">备注</span>
                <input type="text" id="remark" class="form-control" value="${entity.remark!}" placeholder="请输入备注">
            </div>
                <span class="bank-label">&nbsp;</span>


            <div class="input-group" style="text-align: right;">
                <a class="btn btn-info"  href="javascript:query(this)"><span class="glyphicon glyphicon-search"></span> 查找</a>

            </div>
        </form>
     </div>
    </div>

<#include "/view/admin/opermsg.html"/>
<!-- <@shiro.hasPermission name="8.1.5">
<div style="width: 100%; text-align: left;">

    <a  class="btn btn-info" href="${base}/czjorder/summary.do">订单汇总信息</a>
</div>
</@shiro.hasPermission> -->

    <table class="table table-hover table-bordered">
 
        <thead>
    <!--        <tr>
    		<td colspan="5">已支付订单(笔)</td>
    		<td colspan="4">未支付订单(笔)</td>
    </tr> 
       <tr>
    		<td colspan="5" style="color: red">${pay2!}</td>
    		<td colspan="4" style="color: red">${pay1!}</td>
    </tr> -->
        <tr>
            <th>序号</th>
                <th>订单编号</th>

            <th>手机号</th>
            <th>用户昵称</th>
                <th>商家</th>
                <th class="label-hidden">支付方式</th>

                <th>总金额(单位：元)</th>
                <th>订单状态</th>
                <th>下单时间</th>
                <th>备注</th>

            <th>操作</th>
        </tr>
        </thead>
        <tbody>

        <#list pagination.list as c>
            <tr>
                <td>${(pagination.pageNo-1)*pagination.pageSize+1+c_index}</td>
                        <td class="label-hidden">${c.orderCode!}</td>
                            <td>${c.orderCode!}</td>

                <td>${c.phone!}</td>
                <td>${c.nickname!}</td>
                      <#--  <td>
                            <#if c.userinfoId??>
                                    <#list listUserinfoId as lv>
                                        <#if lv.value??&&c.userinfoId == lv.value >
                                        ${lv.name!}
                                        </#if>
                                    </#list>

                            </#if>



                        </td>-->
                        <td> 

                            <#if c.businessId??>
                                    <#list listBusinessId as lv>
                                        <#if lv.value??&&c.businessId == lv.value >
                                        ${lv.name!}
                                        </#if>
                                    </#list>

                            </#if>


                        </td>
                        <td class="label-hidden">${c.paymentType!}</td>

                            <td>${c.totalAmount!}</td>

                        <td> 


                            <#if c.status??>
                                <#if c.status==0>待支付
                                <#elseif c.status==7>待收货
                                <#elseif c.status==8>已完成
                                <#elseif c.status==10>等待退款
                                <#elseif c.status==11>已退款
                                <#elseif c.status==13>待发货
                                <#elseif c.status==16>等待退款
                                <#elseif c.status==17>订单已取消
                                <#elseif c.status==18>退货退款成功
                                </#if>

                            </#if>
                        </td>
                        <td><#if c.createTime?? >${c.createTime?string('yyyy-MM-dd HH:mm:ss')}</#if></td>
                            <td>${c.remark!}</td>


                <td>
                <@shiro.hasPermission name="8.1.1">
                    <a href="${base}/czjorder/detail.do?orderCode=${c.orderCode!}" class="btn btn-info">详情</a>
                </@shiro.hasPermission>    



                </td>
            </tr>


        </#list>
        <#if 0==pagination.totalCount>
            <tr>
                <td colspan="7" style="color: red"> 没有相关数据 </td>
            </tr>
        </#if>





        </tbody>
    </table>
        <!--<span style="text-align: left"> <a href="#" class="btn btn-primary">新增</a></span>-->
<#include "/view/admin/pagination.html"/>


</div>
<script>
    function setPage(pageNo,pageSize){
        var href = "${base}/czjorder/list.do?";

        href+='orderCode='+$('#orderCode').val();
        href+='&'
        href+='businessId='+$('#businessId').val();
        href+='&'
        href+='status='+$('#status').val();
        href+='&'
        href+='createTimeStart='+$('#createTimeStart').val()+"&";
        href+='createTimeEnd='+$('#createTimeEnd').val();
        href+='&'
        href+='remark='+$('#remark').val()+"&";
        href+='phone='+$('#phone').val();


        href+="&pageNo="+pageNo;
        href+="&pageSize="+pageSize;

        location.href=href;
    }
    function checkDelete(url){
        if (window.confirm("确认删除吗?")) {
            location.href=url;
        }
    }

</script>

</body>
</html>
